#
#	redMine - Instant Mobile Feedback (IMF) Plugin
#	Author: Bartłomiej Twardowski
#	Date: 16/06/2010
#


class IMFPluginApplicationController < ApplicationController

	before_filter :authenticate
	

	def authenticate
    	
    	logger.debug "Authenticate user"
    	
    	curr_user = find_current_user
  	
  		if not curr_user
  			authorize
  		end
      	
      	
      	return true
     	
    end
    

	#default error handler -> send as response
	def rescue_action(exception)
  		respond_to do |format|
        	format.html {}
			format.xml  { render :xml => exception }
	    end
	end

end